<!DOCTYPE html>
<html>
	<head>
		<meta charset="UTF-8">
		<title></title>
	</head>
	<body>
	</body>
	<script>
		//数组排序方法一
		var arr1=[1,7,3,9,7,10,54,69,9,2,1];
		for(var i=1;i<arr1.length;i++){
			if(arr1[i-1]>arr1[i]){
				var num=arr1[i-1];
				arr1[i-1]=arr1[i];
				arr1[i]=num;
				i-=2;
			}
		}
		//数组排序方法二
		var arr1=[1,7,3,9,7,10,54,69,9,2,1];
		arr1.sort(function(a,b){
			return a-b;
		})
		console.log(arr1);
	</script>
</html>
